package com.tw;

/**
 * Created by vivekpatil on 6/14/14.
 */


public class Six {
    static int input = 7;


    public static void main(String[] args) throws Exception {


        int temp = input;
        triangle(temp);
        temp = 2;
        triangle(temp);
    }

    static void triangle(int temp) {
        if (temp == input) {
            for (int i = 0; i < input; i++) {
                for (int j = 0; j < temp; j++) {
                    System.out.print(" ");


                }
                temp--;
                for (int k = 0; k < (2 * i + 1); k++) {
                    System.out.print("*");

                }
                System.out.println("");

            }
        } else {
            for (int i = input - 2; i >= 0; i--) {
                for (int j = 0; j < temp; j++) {
                    System.out.print(" ");


                }
                temp++;

                for (int k = 0; k < (2 * i + 1); k++) {
                    System.out.print("*");

                }
                System.out.println("");

            }
        }
    }


}


